﻿using System;

namespace BCCommon.Extensions
{
    public static class DateTimeExtension
    {
        public static long ToUnixEpochTime(this DateTime datetime)
        {
            return (long)Math.Round((datetime.ToUniversalTime() - new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero)).TotalSeconds);
        }
    }
}
